<?php

class sonido extends object_standard {

    //attributes
    protected $id;
    protected $nombre;
    protected $descripcion;
    protected $intensidad;
    protected $duracion;
    protected $tipo;
    protected $ingeniero_sonido;
    protected $videojuego;
    protected $movimiento;
    //components
    var $components = array();
    //auxiliars for primary key and for files
    var $auxiliars = array();

    //data about the attributes
    public function metadata() {
        return array("id" => array(), "nombre" => array(), "descripcion" => array(), "intensidad" => array(), "duracion" => array(), "tipo" => array(),
            "ingeniero_sonido" => array("foreign_name" => "e_s", "foreign" => "empleado", "foreign_attribute" => "cedula"),
            "videojuego" => array("foreign_name" => "v_s", "foreign" => "videojuego", "foreign_attribute" => "id"),
            "movimiento" => array("foreign_name" => "m_s", "foreign" => "movimiento", "foreign_attribute" => "id"));
    }

    public function primary_key() {
        return array("id");
    }

    public function relational_keys($class, $rel_name) {
        switch ($class) {
            case "empleado":
                switch($rel_name){
                    case "e_s":
                        return array("ingeniero_sonido");
                    break;
                }
            break;
        
             case "videojuego":
                switch ($rel_name){
                    case "v_s":
                        return array("videojuego");
                    break; 
                }
            break;
        
                    case "movimiento":
                        switch ($rel_name){
                            case "m_s":
                                return array("movimiento");
                            break;
                        }
                    break;
                
            default:
                break;
        }
    }

}

?>